Security News
NVD Backlog Tops 20,000 CVEs Awaiting Analysis as NIST Prepares System Updates
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
@babel/helper-replace-supers
Advanced tools
@babel/helper-replace-supers is a Babel helper module that assists in handling super method calls and super property accesses in JavaScript classes. It is particularly useful when transforming ES6+ code to ES5, ensuring that the semantics of super calls are preserved correctly.
Super Method Call Replacement
This feature allows you to replace super method calls within a class method. The `replaceSuper` function is used to handle the transformation, ensuring that the correct object and super references are maintained.
const { replaceSuper } = require('@babel/helper-replace-supers');
function replaceSuperMethodCall(path, state) {
replaceSuper(path, state, {
getObjectRef() {
return path.node.object;
},
getSuperRef() {
return path.node.super;
},
file: state.file
});
}
Super Property Access Replacement
This feature allows you to replace super property accesses within a class. Similar to method call replacement, the `replaceSuper` function ensures that property accesses are correctly transformed.
const { replaceSuper } = require('@babel/helper-replace-supers');
function replaceSuperPropertyAccess(path, state) {
replaceSuper(path, state, {
getObjectRef() {
return path.node.object;
},
getSuperRef() {
return path.node.super;
},
file: state.file
});
}
This plugin is part of the Babel preset for transforming ES2015 (ES6) classes to ES5. It handles super method calls and property accesses, ensuring compatibility with older JavaScript environments.
Helper function to replace supers
See our website @babel/helper-replace-supers for more information.
Using npm:
npm install --save @babel/helper-replace-supers
or using yarn:
yarn add @babel/helper-replace-supers
FAQs
Helper function to replace supers
The npm package @babel/helper-replace-supers receives a total of 27,288,490 weekly downloads. As such, @babel/helper-replace-supers popularity was classified as popular.
We found that @babel/helper-replace-supers demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.